<?php
/**
 * Cid.php
 *
 * @copyright   2023 thingsworld.com.cn - All Rights Reserved
 * @link        http://thingsworld.com.cn/
 * @author      stiffer.chen <chenl@thingsworld.com.cn>
 * @created     2023-02-13 16:22:59
 * @modified    2023-02-13 16:22:59
 *
 */

namespace App\Models\User;

use App\Models\BaseModel;

class Cid extends BaseModel
{
    protected $table = 'user_cid';
    public $timestamps = true;
    protected $fillable = [
        'user_id',
        'device_id',
        'platform'
    ];

    public function scopeByUserId($query, $userId)
    {
        return $query->where('user_id', $userId);
    }

    public function scopeByDeviceId($query, $deviceId)
    {
        return $query->where('device_id', $deviceId);
    }

    public function scopeByPlatform($query, $platform)
    {
        return $query->where('platform', $platform);
    }
}